Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: test on bun runtime #101

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open

feat: test on bun runtime #101

wants to merge 30 commits into from

Conversation

whizzzkid
Copy link
Contributor

@whizzzkid whizzzkid commented Aug 3, 2023

In this PR:

  • adding support to run bun as a supported runtime.

Currently failing:

Added file contents: Hello World 101
1 | // createRequire is native in node version >= 12
2 | import { createRequire } from 'module';
3 | const require = createRequire(import.meta.url);
4 | 
5 | const nodeDataChannel = require('../build/Release/node_datachannel.node');
                            ^
TypeError: /home/runner/work/helia-examples/helia-examples/node_modules/node-datachannel/build/Release/node_datachannel.node: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE
      at /home/runner/work/helia-examples/helia-examples/node_modules/node-datachannel/lib/node-datachannel.js:5:25

Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
@whizzzkid whizzzkid marked this pull request as ready for review August 3, 2023 00:49
@whizzzkid whizzzkid marked this pull request as draft August 3, 2023 00:57
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
@achingbrain
Copy link
Contributor

This looks promising, but everything is broken?

@achingbrain
Copy link
Contributor

Also - we don't need to run every single example on bun as this will expose us to having to make sure every framework etc in every example also runs on bun.

Just make it run the helia-101 example on bun as well as node, that should be enough.

@achingbrain achingbrain changed the title feat(runtime): ➕ Adding bun runtime feat: test on bun runtime Feb 8, 2024
@achingbrain
Copy link
Contributor

achingbrain commented Feb 8, 2024

Copy link

vercel bot commented Apr 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
verified-fetch ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2024 7:15pm

@SgtPooki
Copy link
Contributor

SgtPooki commented Apr 24, 2024

I think we need to pull in test-ipfs-example@1.3.0 here for things to work?

@SgtPooki
Copy link
Contributor

seems like bun is not trusting some deps' postinstall scripts.

so node-datachannel is not being found: https://github.com/ipfs-examples/helia-examples/actions/runs/8821723588/job/24218234527?pr=101#step:6:13

Running locally shows:

╰─ ✔ ❯ bun pm untrusted
bun pm untrusted v1.1.4 (fbe2fe0c)

./node_modules/@nestjs/core @10.3.0
 » [postinstall]: opencollective || exit 0

./node_modules/protobufjs @7.2.6
 » [postinstall]: node scripts/postinstall

./node_modules/node-datachannel @0.5.3
 » [install]: prebuild-install -r napi || (npm install --ignore-scripts --production=false && npm run _prebuild)

These dependencies had their lifecycle scripts blocked during install.

If you trust them and wish to run their scripts, use `bun pm trust`.

@SgtPooki
Copy link
Contributor

helia-101 on bun passes now: https://github.com/ipfs-examples/helia-examples/actions/runs/8822048749/job/24219321434?pr=101

@SgtPooki SgtPooki marked this pull request as ready for review April 24, 2024 19:16
Copy link
Contributor

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@SgtPooki
Copy link
Contributor

@SgtPooki
Copy link
Contributor

removal of CustomEvent polyfill from libp2p broke bun build: ipfs-examples/helia-examples/actions/runs/11505470232/job/32027234171?pr=101#step:6:30

With bun v1.1.33, the tests pass for me fine, but they seem to fail in CI.. maybe macOS vs linux?

@SgtPooki
Copy link
Contributor

bun tests passed when I explicitly installed node>20.. https://github.com/ipfs-examples/helia-examples/actions/runs/11505990080/job/32028925951?pr=101

is bun calling node or are we calling it somehow? testing if we can alias node to bun in github CI: 26415bd (#101)

@SgtPooki
Copy link
Contributor

FYI: bun is not running successfully due to some crypto errors

Copy link
Contributor

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self review

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@SgtPooki SgtPooki self-requested a review October 25, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants